/*
 * @Author: your name
 * @Date: 2022-01-17 13:47:33
 * @LastEditTime: 2022-01-20 21:00:21
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \json-serveg:\桌面2\VueStudy\vue-test4\vue-eqidemic\src\api\index.js
 */
/**
 * 请求接口的方法
 */

//导入asios
import axios from 'axios'
//接口地址
import base from './base'
//md5
import md5 from 'md5-js'

//请求方法
const api ={
    /**
     * 疫情获取
     */
    getCovInfo(){
        return axios.get(base.host + base.covInfo)
    },
    getCovData(){
        return axios.get(base.baseUrl + base.covData)
    },
    worldCovData(){
        return axios.get(base.baseUrl + base.worldData)
    },
    getCity(city_name){
        // appid1city_name武汉formatjsontime1545829466密钥
         let rules = md5('appid13564city_name'+city_name+'formatjson5fcd8bfa93523eea5947e3c6bc4e58d2')
        let argumentss = 'format=json&appid=13564&city_name='+ city_name +'&sign=' + rules
        // console.log(argumentss);
        return axios.get(base.baseUrl + base.city + '?' + argumentss) 

         
        //  console.log(rules);
    },
    getSwiperBanner() {
        return axios.get(base.swiperBanner)
    },
    getEpidemicTravel(){
        return axios.get(base.epidemicTravel)
    },
    getTravelCity(params){
        return axios.get(base.travelCity,{
            params
        })
    },
    getCityData(){
        return axios.get(base.getCityData)
    }

}

export default api



